package com.threadPool.pool;

import com.threadPool.enums.RejectedPolicy;

import java.util.concurrent.BlockingDeque;
import java.util.concurrent.TimeUnit;

public interface BaseThreadPool {
    void execute(Runnable task);
    void shutdown();
    void shutdownNow();
    void setCorePoolSize(int newCoreSize);
    void setMaximumPoolSize(int newMaxSize);
    void setKeepAliveTime(long time, TimeUnit unit);
    void setRejectedExecutionHandler(RejectedPolicy handler);
    void allowCoreThreadTimeOut(boolean value);
    int getCorePoolSize();
    int getMaximumPoolSize();
    long getKeepAliveTime(TimeUnit unit);
    BlockingDeque<Runnable> getQueue();
    RejectedPolicy getRejectedExecutionHandler();
    boolean allowsCoreThreadTimeOut();
    void beforeExecute(Thread t, Runnable task);
    void afterExecute(Runnable task, Throwable thrown);
    int getActiveThreads();
}
